package com.sjg.sys.service;

import com.sjg.sys.entity.SysResources;
import com.sjg.sys.entity.SysRoleResources;
import com.sjg.sys.utils.CommUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

import com.sjg.sys.dao.SysRoleResourcesDao;

@Service
public class SysRoleResourcesService{

    @Resource
    private SysRoleResourcesDao sysRoleResourcesDao;

    public int insert(SysRoleResources pojo){
        pojo.setId(CommUtil.getPrimaryKey());
        return sysRoleResourcesDao.insert(pojo);
    }

    public int insertSelective(SysRoleResources pojo){
        pojo.setId(CommUtil.getPrimaryKey());
        return sysRoleResourcesDao.insertSelective(pojo);
    }

    public int insertList(List<SysRoleResources> pojos){
        for(SysRoleResources roleResources:pojos){
            roleResources.setId(CommUtil.getPrimaryKey());
        }
        return sysRoleResourcesDao.insertList(pojos);
    }

    public int update(SysRoleResources pojo){
        return sysRoleResourcesDao.update(pojo);
    }
}
